package org.aeon.colorfulplanebattle.view.panel;

import org.aeon.colorfulplanebattle.view.GameState;
import org.aeon.colorfulplanebattle.view.components.Process;
import org.aeon.colorfulplanebattle.view.components.*;

import javax.swing.*;

/**
 * @author: MissingAeon
 * @date: 2024/1/8 19:45
 * @description:
 */
public class ContentPanel extends JLayeredPane {
    private final GameState gameState;

    public ContentPanel(GameState gameState) {
        this.gameState = gameState;
        // 将计分添加到“调色板”图层
        this.add(new Scoreboard(this.gameState), JLayeredPane.PALETTE_LAYER);
        // 将时钟添加到“调色板”图层
        this.add(new Clock(this.gameState), JLayeredPane.PALETTE_LAYER);
        // 将生命值添加到“调色板”图层
        this.add(new BloodBar(this.gameState), JLayeredPane.PALETTE_LAYER);
        // 将难度添加到“调色板”图层
        this.add(new Process(this.gameState), JLayeredPane.PALETTE_LAYER);
        // 将战场加到默认层
        this.add(new Battlefield(this.gameState), JLayeredPane.DEFAULT_LAYER);
    }
}
